<?php
	include("includes/connect_db.php");
    $aksi = $_POST['aksi'];
    $data_input = $_POST['data_input'];

    switch ($aksi) {
    	case '1':
    		$sql_check_user = "SELECT * FROM tb_user WHERE username = '$data_input'";
            $query_check_user = mysql_query($sql_check_user);
            if (mysql_num_rows($query_check_user) == 0) {
                echo "valid";
            }
            break;
        case '2':
            $sql_check_user = "SELECT * FROM tb_user WHERE kode_user = '$data_input'";
            $query_check_user = mysql_query($sql_check_user);
            if (mysql_num_rows($query_check_user) == 0) {
                echo "valid";
            }
            break;
        case '3':
            $sql_check_user = "SELECT * FROM tb_user WHERE email = '$data_input'";
            $query_check_user = mysql_query($sql_check_user);
            if (mysql_num_rows($query_check_user) == 0) {
                echo "valid";
            }
    		break;
    }
?>